#!/bin/bash
set -eauo pipefail

# Customizing s6-overlay behaviour
# https://github.com/just-containers/s6-overlay?tab=readme-ov-file#customizing-s6-overlay-behaviour
S6_VERBOSITY=${S6_VERBOSITY:-1}
S6_KEEP_ENV=${S6_KEEP_ENV:-0}
S6_BEHAVIOUR_IF_STAGE2_FAILS=${S6_BEHAVIOUR_IF_STAGE2_FAILS:-2}
S6_KILL_FINISH_MAXTIME=${S6_KILL_FINISH_MAXTIME:-5000}
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=${S6_CMD_WAIT_FOR_SERVICES_MAXTIME:-5000}

# Activate Python virtual environment
PYTHON_VIRTUALENV_PATH="${PYTHON_VIRTUALENV_PATH:-/venv}"
source "${PYTHON_VIRTUALENV_PATH}/bin/activate"

exec /init "$@"
